package com.itjh.mapper;

import com.itjh.pojo.Dept;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 部门管理
 */
@Mapper
public interface DeptMapper {

    @Select("select * from dept")
    List<Dept> selectAll();

    @Delete("delete from dept where id = #{id}")
    int deleteById(Integer id);

    @Insert("insert into dept values (null,#{name},#{createTime},#{updateTime});")
    @Options(useGeneratedKeys = true,keyProperty = "id")
    int insertDept(Dept dept);

    //根据部门id查询部门回显
    @Select("select * from dept where id = #{id}")
    Dept getById(Integer id);
    public int updateDeptById(Dept dept);
}
